/**
 * 去除对象重复项
 * @param arr 要去重的数组
 * @param key 以对象中哪个字段进行去重
 */
const filterRepeat = (arr, key) => {
    let obj = {}
    let newArr1 = arr.reduce((acc, cur) => {
        if (!obj[cur[key]] && cur[key]) {
            obj[cur[key]] = cur[key]
            acc.push(cur)
        }
        return acc
    }, [])
    return newArr1
}
const isArr = (arr) => {

    return Object.prototype.toString.call(arr) == '[object Array]';

}
export {
    filterRepeat,
    isArr
}